package com.geeke.sys.service;

import java.util.List;

import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.apache.commons.lang3.StringUtils;

import com.geeke.common.service.CrudService;
import com.geeke.common.data.PageRequest;
import com.geeke.common.data.Parameter;
import com.geeke.config.exception.CommonJsonException;

import com.geeke.sys.dao.ResourceDao;
import com.geeke.sys.entity.Resource;
import com.geeke.utils.ResultUtil;
import com.geeke.utils.constants.ErrorEnum;
import com.google.common.collect.Lists;

/**
 * 资源表 Service
 */
@Service("resourceService")
@Transactional(readOnly = true)
public class ResourceService extends CrudService<ResourceDao, Resource> {

    @Transactional(readOnly = false)
    @Override
    public Resource save(Resource resource) {
        // 编号和权限允许重复，不需要做重复性检查
        Resource resourceTemp = super.save(resource);
        return resourceTemp;
    }

    @Override
    @Transactional(readOnly = false)
    public int delete(Resource resource) {
        int rows = super.delete(resource);
        return rows;
    }
} 